//part1:C03:ep3.2.3:ep3.2.3.cpp
#include <iostream>
#include <string>
int main(void)
{
    const std::string s = "0123456789ABCDEF";
    std::cout << "Enter a eries of numbers between 0 and 15"
        << " separated by spaces. Hit ENTER when finished: "
        << std::endl;
    std::string result;
    std::string::size_type n;
    while(std::cin >> n)
    {
        if(n < s.size())
        {
            result += s[n];
        }
    }
    std::cout << "Your hex number is: " << result << std::endl;
    return 0;
}